package com.qf.controller;

import com.qf.entity.Student;
import com.qf.service.StudentService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 徐老板
 * @date 2020/3/25   8:50
 */
@Controller
public class StudentController {

    @Resource
    private StudentService studentService;

    /**
     *@RequestParam(defaultValue = "1") int pageIndex, String startTime, String endTime,
     *                           int typeId, ModelMap modelMap
     */

    @RequestMapping("/student")
    public String findAll(ModelMap modelMap){
        List<Student> studentList = studentService.findAll();
//        System.out.println(studentList);
        modelMap.addAttribute("stus",studentList);

        return "show";

    }


}
